home *** CD-ROM | disk | FTP | other *** search
- echo off
- cls
- if not %1!==?! goto start
- echo BKL-ALT.BAT Dan Goodell 12/91 (version 1)
- echo
- echo This batch file will backup assorted files and/or directories that are
- echo specified in a .LST (list) file. The list file must be on the specified
- echo drive where the .LZH backup file will be recorded. The date stamp of an
- echo .UPD (update) directory entry will be recorded with the date and time of
- echo the backup.
- echo This batch file is designed around the free file compression and
- echo uncompression utility LHA.EXE.
- echo
- echo (This version is capable of chaining errors from "COMMAND /C" calls.)
- echo (Use this version with DOS 3.2 or earlier.)
- echo
- goto syntax
-
- :start
- if %1!==chain! set chain=Y
- if %1!==CHAIN! set chain=Y
- if %chain%!==Y! shift
- for %%d in (a: A: b: B:) do if %%d!==%2! set drv=%2
- if %drv%!==! goto noparm
- :pack
- echo checking drive %drv% for %1.LST file...
-
- rem ----remove next two lines if CHKDRV.COM not used-----
- CHKDRV %drv%
- if errorlevel 2 goto baddrv
-
- if not exist %drv%\%1.lst goto baddisk
- LHA u /x1 /z2 %drv%%1.lzh @%drv%%1.lst /wC:
- if errorlevel 2 goto packerr
- :packdone
- echo
- echo updating .UPD stamp...
- rem > %drv%\%1.upd
- echo %1 files backup completed.
- echo
- goto errors
- :baddrv
- echo
- echo ERROR! Drive %drv% not ready. Unable to backup %1 files.
- echo
- if exist bkerr.err goto baddrv1
- echo set err=Error list: >bkerr.err
- :baddrv1
- echo set err=%%err%% %1 >>bkerr.err
- goto errors
- :baddisk
- echo
- echo ERROR! Disk in drive %drv% does not contain %1.LST backup list.
- echo Unable to backup %1 files.
- echo
- if exist bkerr.err goto baddisk1
- echo set err=Error list: >bkerr.err
- :baddisk1
- echo set err=%%err%% %1 >>bkerr.err
- goto errors
- :packerr
- echo
- echo ERROR! LHA unable to backup %1 files.
- echo
- if exist bkerr.err goto packerr1
- echo set err=Error list: >bkerr.err
- :packerr1
- echo set err=%%err%% %1 >>bkerr.err
- goto errors
- :errors
- if %chain%!==Y! goto end
- if not exist bkerr.err goto end
- echo
- echo WARNING! The following backups were not completed due to errors:
- echo echo off >>bkerr.err
- echo ctty con >>bkerr.err
- echo echo %%err%%>>bkerr.err
- echo set err=>>bkerr.err
- ctty nul
- ren bkerr.err bkerr.bat
- c:\command /c bkerr
- del bkerr.bat
- ctty con
- echo
- goto end
- :noparm
- echo
- echo ERROR! Incorrect parameters.
- echo command: BKL-ALT %1 %drv%
- echo
- :syntax
- echo BKL-ALT.BAT backup program
- echo Syntax: BKL-ALT [chain] list d:
- echo where: d: = destination drive of backup (A: or B:)
- echo list = name of backup list (on dest drive)
- echo chain = optional parameter used when calling
- echo BKL.BAT from a batch file to retain a
- echo running error list of incomplete backups
- echo
- :end
- set chain=
- set drv=
-